<% unless scope[:pipeline].nil? %>
    <%- if is_config_used_to_run_this_stage_out_of_sync_with_current?(scope[:current_config_version], scope[:stage_config_version]) -%>
        <div class='config_changed_info notification'>
            <p class='information'>Configuration has since been updated and any operations performed will use the current configuration</p>
        </div>
    <%- end -%>
    <div class="pipeline">

        <ul class="stages">
            <%
               scope[:after_selected] = false
               scope[:pipeline].getStageHistory().each_with_index do |stage_in_status_bar, idx_in_status_bar|
                   scope[:selected] = params[:stage_name]==(scope[:stage_name]=stage_in_status_bar.getName())
                   scope[:stage_class] = "stage"
                   scope[:show_stage_actions_id] = id_for(stage_in_status_bar, "show_stage_actions")
                   if scope[:selected]
                       scope[:stage_class] += " selected"
                       scope[:after_selected] = true
                   elsif scope[:after_selected]
                       scope[:after_selected] = false
                       scope[:stage_class] += " after_selected"
                   end
            %>
                    <li style='<%= scope[:pipeline].numberOfStages() < 9 ? "width: " + stage_width_percent(scope[:pipeline].numberOfStages(), scope[:selected], 100) : "max-width: 300px" %>' class="<%= scope[:stage_class] %>">
                        <div class="wrapper">
                            <%= render :partial => "pipelines/pipeline_stage_bar", :locals => {:scope => {:idx_in_status_bar => idx_in_status_bar, :stage_in_status_bar => stage_in_status_bar, :pipeline_name => scope[:pipeline_name], :pipeline_counter => scope[:pipeline_counter], :stage_name => scope[:stage_name], :stage_counter => scope[:stage_counter], :stage_details_action => scope[:stage_details_action]}} -%>
                        </div>
                    </li>
            <% end %>
        </ul>
    </div>
<% end %>
